/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.rec.be;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Programador
 */
@Entity
@Table(name = "REC_HISTORIAL_CREDITICIO")
@NamedQueries({@NamedQuery(name = "HistorialCrediticio.findAll", query = "SELECT h FROM HistorialCrediticio h"), @NamedQuery(name = "HistorialCrediticio.findByIdHistorialCrediticio", query = "SELECT h FROM HistorialCrediticio h WHERE h.idHistorialCrediticio = :idHistorialCrediticio"), @NamedQuery(name = "HistorialCrediticio.findByFechaRegistro", query = "SELECT h FROM HistorialCrediticio h WHERE h.fechaRegistro = :fechaRegistro")})
public class HistorialCrediticio implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_HISTORIAL_CREDITICIO", nullable = false)
    private Long idHistorialCrediticio;
    @Column(name = "FECHA_REGISTRO")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaRegistro;
    @JoinColumn(name = "FID_REC_CARTERA", referencedColumnName = "ID_CARTERA")
    @ManyToOne(fetch = FetchType.LAZY)
    private Cartera fidRecCartera;

    public HistorialCrediticio() {
    }

    public HistorialCrediticio(Long idHistorialCrediticio) {
        this.idHistorialCrediticio = idHistorialCrediticio;
    }

    public Long getIdHistorialCrediticio() {
        return idHistorialCrediticio;
    }

    public void setIdHistorialCrediticio(Long idHistorialCrediticio) {
        this.idHistorialCrediticio = idHistorialCrediticio;
    }

    public Date getFechaRegistro() {
        return fechaRegistro;
    }

    public void setFechaRegistro(Date fechaRegistro) {
        this.fechaRegistro = fechaRegistro;
    }

    public Cartera getFidRecCartera() {
        return fidRecCartera;
    }

    public void setFidRecCartera(Cartera fidRecCartera) {
        this.fidRecCartera = fidRecCartera;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idHistorialCrediticio != null ? idHistorialCrediticio.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HistorialCrediticio)) {
            return false;
        }
        HistorialCrediticio other = (HistorialCrediticio) object;
        if ((this.idHistorialCrediticio == null && other.idHistorialCrediticio != null) || (this.idHistorialCrediticio != null && !this.idHistorialCrediticio.equals(other.idHistorialCrediticio))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.upn.sigemfi.rec.be.HistorialCrediticio[idHistorialCrediticio=" + idHistorialCrediticio + "]";
    }

}
